package cn.bravolinks.controller;

import cn.bravolinks.model.DefinedEntity;
import cn.bravolinks.util.Singleton;
import cn.bravolinks.util.TestModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/test")
public class HelloController {

    @Autowired
    private DefinedEntity de;

    @RequestMapping("/hello")
    public void sayHello(){
        new Thread().run();
        Singleton single1 = Singleton.getIntance();
        Singleton single2 = Singleton.getIntance();
        Singleton single3 = Singleton.getIntance();
        System.out.println(single1);
        System.out.println(single2);
        System.out.println(single3);
        TestModel de1 = new TestModel("aa","1233434");
        TestModel de2 = new TestModel("aa","1233434");
        TestModel de3 = new TestModel("aa","1233434");
        System.out.println(de1);
        System.out.println(de2);
        System.out.println(de3);
        System.out.println(de.toString());

        List list = new ArrayList<String>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        for (Object s:list)
            System.out.println(s);



    }
}
